package com.visec.hdy.hadoop.context;

import java.io.File;
import java.util.ArrayList;
import java.util.List;

/**
 * 定制:时间排序数据读上下文实现类
 * 
 * @author hdy
 *
 */
public class TimeLogReadContextImpl extends LogReadContextImpl {

	public TimeLogReadContextImpl(String nameSpace, long count) {
		super(nameSpace, count);
	}

	@Override
	public List<File> sortFiles(List<File> files) {
		this.files = new ArrayList<>();
		files.stream().sorted((a, b) -> a.getName().compareTo(b.getName())).forEach((a) -> this.files.add(a));
		return this.files;
	}

}
